﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;
using Microsoft.ApplicationBlocks.Data;
using AnyOffice.BIZ;

namespace AnyOffice.general.meeting.record
{
    public partial class record_detail : ModulePage
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            int num = (Request.QueryString["meeting_id"] != null) ? int.Parse(Request.QueryString["meeting_id"].ToString()) : 0;
            string commandText = "SELECT [Name],[RecordReader],[AttachmentId],[RecordContent], dbo.GetUserNames([RecordReader]) AS RecordReaderName FROM [dbo].[Meeting] WHERE [MeetingId] = @MeetingId";
            SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@MeetingId", SqlDbType.Int) };
            commandParameters[0].Value = num;
            DataTable table = SqlHelper.ExecuteDataset(base.Conn, CommandType.Text , commandText, commandParameters).Tables[0];
            if (table.Rows.Count > 0)
            {
                this.litName.Text = table.Rows[0]["Name"].ToString();
                if (table.Rows[0]["RecordContent"] != DBNull.Value)
                {
                    this.litRecordContent.Text = table.Rows[0]["RecordContent"].ToString();
                }
                if (table.Rows[0]["AttachmentId"] != DBNull.Value)
                {
                    string attachmentId = table.Rows[0]["AttachmentId"].ToString();
                    if ((this.litAttachment.Text = AttachmentBiz.Display(base.Conn, attachmentId)) == string.Empty)
                    {
                        this.litAttachment.Text = "无";
                    }
                }
            }
            else
            {
                this.pnlMain.Visible = false;
                this.litMessage.Text = base.ShowPromptClose("无此会议纪要");
            }
        }
 

    }
}
